package edu.zju.gis.dbfg.model.statistic;

import lombok.Getter;
import lombok.Setter;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;

@Getter
@Setter
public class LUXZQStatisticArgs implements Serializable{
    private final static Logger logger = LoggerFactory.getLogger(LUXZQStatisticArgs.class);
    @Option(name = "-output",usage = "输出文件路径", required = true)
    private String output;

    @Option(name = "-input2",usage = "输入数据,target", required = true)
    private String input2;

    @Option(name = "-type2",usage = "输入数据类型,extent", required = true)
    private String type2;

    @Option(name = "-dlbmIndex2",usage = "分类字段(dlbm),target")
    private String dlbmIndex2="DLBM";
    //private String dlbmIndex2="6";

    @Option(name = "-zldwdmIndex2",usage = "行政区划字段,target")
    private String zldwdmIndex2="ZLDWDM";
    //private String zldwdmIndex2="11";

    @Option(name = "-areaIndex2",usage = "面积字段(TBMJ),target")
    private String areaIndex2="TBMJ";
    //private String areaIndex2="16";

    @Option(name = "-jareaIndex2",usage = "净面积字段(TBDLMJ),target")
    private String jareaIndex2="TBDLMJ";
    //private String jareaIndex2="17";

    @Option(name = "-kcdlbmIndex2",usage = "扣除部分分类字段(kcdlbm),target")
    private String kcdlbmIndex2="KCDLBM";
    //private String kcdlbmIndex2="13";

    @Option(name = "-xzq",usage = "行政区范围", required = true)
    private String xzq="";

    @Option(name = "-crs2",usage = "target crs")
    private String crs2 = "4326";

    @Option(name = "-parallelize", usage="parallelize num")
    private int partitionNum = 4;

    public  static LUXZQStatisticArgs initArgs(String args[]){
        LUXZQStatisticArgs mArgs = new LUXZQStatisticArgs();
        CmdLineParser parser = new CmdLineParser(mArgs);
        try {
            parser.parseArgument(args);
            return mArgs;
        } catch (CmdLineException e) {
            logger.error(e.getLocalizedMessage());
            return null;
        }
    }
}
